<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<head>
	<%@ page pageEncoding="utf-8"%>
	<% request.setAttribute("path",request.getContextPath());%>
	<%@ page import="com.glodon.paas.account.web.util.SecurityUtils" %>
	<meta charset="utf-8">
	<script src="${path}/js/libs/jquery/jquery.js"></script>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>广联云</title>
	<link rel="stylesheet" type="text/css" href="${path}/css/glodon.reset.css" />
	<link rel="stylesheet" type="text/css" href="${path}/css/header.css" />
	<meta name="description" content="">
	<meta name="author" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes" >
</head>
<body>
	<div id="agree-content">
		<header class="glodon_header clearfix">
		    <div class="glodon_headerBg">
		        <div id="notify-wrapper" hidden><span id="notify" class=""><span id="notify-msg"></span></span></div>
		        <div class="glodon_header_wrap clearfix">
		            <nav class="clearfix">
		                <div id="glodon_logo" class="clearfix">
		                    <a href="<%=request.getContextPath()%>">通行证</a>
		                </div>
		            </nav>
		            <aside id="glodon_header_aside clearfix"></aside>
		        </div>
		    </div>
		</header>
		<div id="pagenav">
		</div>
		<div id="agree-groups" style="margin-top: 30px">
			<div class="agree-content">
				谁谁谁邀请你加入组织
			</div>
			<div>
				<button class="btn" id="agree">agree</button>
				<button class="btn" id="deny">deny</button>
			</div>
		</div>
	</div>
</body>
<script>
	$(function(){
		var inviteCode  = window.location.pathname.substring( window.location.pathname.lastIndexOf("/") + 1);
		$("#agree").click(function(){
			$.ajax({
				url : "/account/member/invite/"+ inviteCode,
				dataType : "json",
				type : "post",
				success : function(data){
					if(data.result == "success")
					{
						window.window.location = "/account";
					}
					
				}
			});
		});
		
		$("#deny").click(function(){
			$.ajax({
				url : "/account/member/invite/"+inviteCode,
				dataType : "json",
				type : "delete",
				success : function(data){
					if(data.result == "success")
					{
						window.window.location = "/account";
					}
					
				}
			});
		});
	});
</script>
</html>
